package com.ztgf.commodity.mapper;

import com.ztgf.commodity.models.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * author: chenyu.wang
 * date: 2020-08-03 10:04
 * Description: 商城商品详情页映射
 */
@Mapper
public interface CommodityDetailsPageMapper {

    /**
     * description: 商城商品详情页
     * param: [goodsId]
     * author: chenyu.wang
     * date: 2020-08-03
     * return: com.ztgf.commodity.models.vo.CommodityDetailsPageVO
     */
    CommodityDetailsPageVO queryCommodityDetailsPageData(@Param("goodsId") Long goodsId);

    /**
     * description: 商品详情页商品销量统计
     * param: [goodsId]
     * author: chenyu.wang
     * date: 2020-08-03
     * return: java.lang.Integer
     */
    Integer querySalesStatistics(@Param("goodsId") Long goodsId);

    /**
     * description: 商品详情页商品评价统计
     * param: [goodsId]
     * author: chenyu.wang
     * date: 2020-08-03
     * return: java.lang.Integer
     */
    Integer queryEvaluationStatistics(@Param("goodsId") Long goodsId);

    /**
     * description: 商品详情页商品收藏人气
     * param: [goodsId]
     * author: chenyu.wang
     * date: 2020-08-03
     * return: java.lang.Integer
     */
    Integer queryFavoritePopularity(@Param("goodsId") Long goodsId);

    /**
     * description: 商城商品详情页同类商品推荐
     * param: [id]
     * author: chenyu.wang
     * date: 2020-08-03
     * return: java.util.List<com.ztgf.commodity.models.vo.CommoditySimilarVO>
     */
    List<CommoditySimilarVO> queryRecommendSimilarProducts(@Param("id") Long id);

    /**
     * description: 根据分类id，查询关联规格信息
     * param: [id]
     * author: chenyu.wang
     * date: 2020-06-03
     * return: java.util.List<com.ztgf.commodity.models.vo.SpecificationCategoryVO>
     */
    List<SpecificationCategoryVO> getSpecificationCategory(@Param("id") Long id, @Param(value = "brandId") Long brandId);

    /**
     * description: 根据规格id，查询规格属性
     * param: [id] 规格id
     * author: chenyu.wang
     * date: 2020-06-08
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityAttrVO>
     */
    List<CommodityAttrVO> getAttrList(@Param("id") Long id);

    /**
     * description: 根据商品id，查询商品套餐情况
     * param: [id]
     * author: chenyu.wang
     * date: 2020-08-03
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityComboRelationVO>
     */
    List<CommodityComboRelationVO> commodityPackage(@Param("goodsId") Long goodsId);

    /*
     * @description:获取商品所拥有的规格属性
     * @author: chenyu.wang
     * @date: 2020-09-08
     */
    List<SpecificationCategoryVO> queryGoodsAttrs(@Param("goodsId") Long goodsId);

    /*
     * @description:根据规格id获取商品所拥有的属性
     * @author: chenyu.wang
     * @date: 2020-09-08
     */
    List<CommodityAttrVO> queryGoodsAttrBySpecificationId(@Param("specificationId") Long specificationId, @Param("goodsId") Long goodsId);

    /*
     * @description:获取商品所有库存
     * @author: chenyu.wang
     * @date: 2020-09-09
     * @return:
     */
    Integer getGoodsAllInventoryNumber(@Param("goodsId") Long goodsId);
}
